// search模块的小仓库
import { reqSearchList } from '@/api'
const actions = {
  async searchList({ commit }, params) {
    let result = await reqSearchList(params);
    if (result.code === 200) {
      commit('SEARCH_LIST', result.data);
    }
  }
};
const mutations = {
  SEARCH_LIST(state, searchList) {
    state.searchList = searchList;
  }
};
const state = {
  searchList: {},
};
const getters = {
  attrsList(state) {
    return state.searchList.attrsList || [];
  },
  goodsList(state) {
    return state.searchList.goodsList || [];
  },
  trademarkList(state) {
    return state.searchList.trademarkList || [];
  },
  total(state){
    return state.searchList.total || 0;
  },
};
export default {
  namespaced: true,
  actions,
  mutations,
  state,
  getters,
}